<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var time = prompt("请输入时间点，可输入的值有 12，  18，  23，");
      var num = Number(time)
      switch (num) {
        case  12:
          alert("中午好");
          break;
        case  18:
          alert("傍晚好");
          break;

        case  23:
          alert("深夜好");
          break;

        default:
          alert("可输入的值有 12，  18，  23，");
          break;
      }
    </script>
  </body>
</html>

